import React from 'react';
import { StyleSheet, Text, View, Image, TouchableOpacity, PixelRatio } from "react-native";
import { GLOBAL } from '../../../../../config/global';

const failPic = require('../../../../../imgs/store/fail.png');
const successPic = require('../../../../../imgs/store/success.png');
const scale = GLOBAL.SCALE;
//底部审批按钮
export const ApproveButton = (props) => {

	const { agreePress, refusePress } = props;

	return (
		<View style={styles.bottomBtnCell}>
			<TouchableOpacity activeOpacity={0.5} style={styles.bottomBtn}
				onPress={refusePress} >
				<View style={[styles.bottomBtnView, styles.bottomBtnViewLeft]}>
					<Image source={failPic} style={styles.bottomBtnPic} />
					<Text style={styles.bottomBtnText}>驳回</Text></View>
			</TouchableOpacity>
			<TouchableOpacity activeOpacity={0.5} style={styles.bottomBtn}
				onPress={agreePress} >
				<View style={styles.bottomBtnView}>
					<Image source={successPic} style={styles.bottomBtnPic} />
					<Text style={styles.bottomBtnText}>同意</Text></View>
			</TouchableOpacity>
		</View>
	)

}

const styles = StyleSheet.create({
	bottomBtnCell: {
		width: 375 * scale,
		height: 60 * scale,
		flexDirection: 'row',
		borderTopColor: '#e4e4e4',
		borderTopWidth: 1 / PixelRatio.get(),
		backgroundColor: '#fff',
	},
	bottomBtn: {
		justifyContent: 'center',
		flex: 1,
	},
	bottomBtnPic: {
		marginRight: 20 * scale,
	},
	bottomBtnView: {
		flexDirection: 'row',
		justifyContent: 'center',
		alignItems: 'center',
	},
	bottomBtnViewLeft: {
		borderRightColor: '#e4e4e4',
		borderRightWidth: 1 / PixelRatio.get(),
	},
	bottomBtnText: {
		fontSize: 18 * scale,
		color: '#404040'
	},
})